﻿package com.sorayume.visuals
{
		import flash.display.MovieClip;
		import flash.display.Loader;
		import flash.net.URLRequest;
		
		public class SY_World extends MovieClip
	{
		private var instanceHud:Boolean = false;
		private var instanceStage:Boolean = false;
		private var systage:SY_Stage = null;
		private var syhud:SY_Hud = null;
		//private var mainc_Array:Array = [SY_Stage,SY_Hud];
//		private var mainn_Array:Array = ["systage", "syhud"];
//		
		public function SY_World(ourheight:int,ourwidth:int)
		{
			trace ("world instanced");
			loadHud();
			loadStage();
			//loadMe();
			//constructor function
		}
		
		/*private function loadMe():*
		{
			for (var i in mainn_Array)
			{
				var (mainn_Array[i]) = new (mainc_Array[i]);
				addChild(mainn_Array[i]);
			}
		}*/
		
		private function loadHud():*
		{
		
			if(instanceHud != true)
			{
				syhud = new SY_Hud();
				instanceHud = true;
				addChild(syhud);
			}
			
			else if (instanceHud == true)
			{
				trace("HUD class already instanced.");
			}
		}
		
		private function loadStage():*
		{
			if(instanceStage != true)
			{
				systage = new SY_Stage();
				instanceStage = true;
				addChildAt(systage, 0);
			}
			else if (instanceStage == true)
			{
				trace ("Game Stage class already instanced.");
			}
			return systage;
		}
		
	}
}